package com.aishua.andpaydemo.activity;

import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.aishua.andpaydemo.ImageloaderHelper;
import com.aishua.andpaydemo.R;

import org.w3c.dom.Text;

/**
 * Created by aishua on 2018/5/18.
 */

public class ChengcheActivity extends BaseActivity implements View.OnClickListener {

    private ImageView img_title_xiaoxi;
    private TextView tv_title;
    private TextView tv_setting;
    private ImageView img_erweima;

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_chengchema);
        initTitleView();
        initView();
    }


    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    private void initTitleView() {

        img_title_xiaoxi = findViewById(R.id.img_title_xiaoxi);
        img_erweima = findViewById(R.id.img_erweima);
        tv_title = findViewById(R.id.tv_title);
        tv_setting = findViewById(R.id.tv_setting);

        tv_title.setText("乘车码");
        tv_setting.setVisibility(View.INVISIBLE);
        img_title_xiaoxi.setBackground(getDrawable(R.drawable.back));
        img_title_xiaoxi.setOnClickListener(this);
    }

    private void initView() {

        img_erweima = findViewById(R.id.img_erweima);
        img_erweima.setOnClickListener(this);

    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @Override
    public void onClick(View v) {

        switch (v.getId()) {

            case R.id.img_erweima:

                img_erweima.setBackground(getDrawable(R.drawable.saomachenggong));

                break;
            case R.id.img_title_xiaoxi:

                finish();

                break;


        }
    }
}
